package cc.ccoke.design.factory.simple;

import cc.ccoke.design.factory.entity.Animal;
import cc.ccoke.design.factory.entity.Cat;
import cc.ccoke.design.factory.entity.Dog;

/**
 * 小动物工厂
 * @author ccoke
 */
public class AnimalFactory {
    public static Animal getAnimal(String type) {
        switch (type) {
            case "dog":
                return new Dog();
            case "cat":
                return new Cat();
            default:
                return null;
        }
    }
}
